import * as home from './action-type';

// 保存登录用户信息
let defaultStateLoginUser = {
	imgpath: "imgpath11",//图片地址
	name: "name11",//姓名
	orderSum: "orderSum11",//金额
	phoneNo: "phoneNo11",//手机号
	isLogin: true,//是否登录
};
export const loginUser = (state = defaultStateLoginUser , action = {}) => {
	switch(action.type){
		case home.SAVELOGINUSER:
			return {...state, ...{[action.datatype]: action.value}};
		default:
			return state;
	}
}

// 保存登录用户权限
let defaultStateLoginPerm = {
	flag1: false,
	flag2: false,
	flag3: false,
};
export const loginPerm = (state = defaultStateLoginPerm , action = {}) => {
	switch(action.type){
		case home.SAVELOGINPERM:
			return {...state, ...{[action.datatype]: action.value}};
		default:
			return state;
	}
}